package com.w7vm.menuweb.entity;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.Cascade;

import java.util.Date;
import java.util.List;
import java.util.Set;


/**
 * The persistent class for the CardapioBuffetWeb database table.
 * 
 */
@Entity
@NamedQueries({
	@NamedQuery(name="CardapioBuffet.findCardapioBuffetByIDSede", 
			query="SELECT b" +
					" FROM CardapioBuffetWeb b" +
					" JOIN b.restauranteSedeWeb s" +
					" WHERE s.idRestauranteSedeWeb = :idRestaurante" +
					" AND b.status = 1"),

	@NamedQuery(name="CardapioBuffet.findCardapioBuffetByIDFilial", 
					query="SELECT b" +
							" FROM CardapioBuffetWeb b" +
							" JOIN b.restauranteFilialWeb f " +
							" WHERE f.idRestauranteFilialWeb = :idRestaurante"),
							
							
	@NamedQuery(name="CardapioBuffet.findCardapioBuffetByID", 
					query="SELECT bf" +
									" FROM CardapioBuffetWeb bf" +
									" JOIN bf.composicaoCardBuffetWebs cb " +
									" WHERE bf.idCardapioBuffetWeb = :idBuffet"),
})

public class CardapioBuffetWeb implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String FIND_BUFFET_BY_IDRESTAURANTESEDE = "CardapioBuffet.findCardapioBuffetByIDSede";
	public static final String FIND_BUFFET_BY_IDRESTAURANTEFILIAL = "CardapioBuffet.findCardapioBuffetByIDFilial";
	public static final String FIND_BUFFET_BY_ID = "CardapioBuffet.findCardapioBuffetByID";

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int idCardapioBuffetWeb;

	@Column(name="NomeBuffet")
	private String nomeBuffet;
	
	@Column(name="Cortesia")
	private String cortesia;

	@Column(name="DiasSemana")
	private String diasSemana;

    @Temporal( TemporalType.DATE)
	@Column(name="DtInicio")
	private Date dtInicio;
    
    @Temporal( TemporalType.DATE)
	@Column(name="DtCadastro")
	private Date dtCadastro;

    @Temporal( TemporalType.DATE)
	@Column(name="DtTermino")
	private Date dtTermino;

	@Column(name="EntradasFrias")
	private String entradasFrias;

	@Column(name="EntradasQuentes")
	private String entradasQuentes;

	@Column(name="Sobremesa")
	private String sobremesa;

	@Column(name="Status")
	private int status;
	
	@Column(name="Image")
	private String image;

	//bi-directional many-to-one association to RestauranteFilialWeb
    @ManyToOne
	@JoinColumn(name="idRestauranteFilial")
	private RestauranteFilialWeb restauranteFilialWeb;

	//bi-directional many-to-one association to RestauranteSedeWeb
    @ManyToOne
	@JoinColumn(name="idRestauranteSede")
	private RestauranteSedeWeb restauranteSedeWeb;

	//bi-directional many-to-one association to ComposicaoCardBuffetWeb
	@OneToMany(mappedBy="cardapioBuffetWeb",fetch=FetchType.EAGER, cascade=CascadeType.ALL,orphanRemoval=true)
	private List<ComposicaoCardBuffetWeb> composicaoCardBuffetWebs;

    public CardapioBuffetWeb() {
    }

	public int getIdCardapioBuffetWeb() {
		return this.idCardapioBuffetWeb;
	}

	public void setIdCardapioBuffetWeb(int idCardapioBuffetWeb) {
		this.idCardapioBuffetWeb = idCardapioBuffetWeb;
	}

	public String getCortesia() {
		return this.cortesia;
	}

	public void setCortesia(String cortesia) {
		this.cortesia = cortesia;
	}

	public String getDiasSemana() {
		return this.diasSemana;
	}

	public void setDiasSemana(String diasSemana) {
		this.diasSemana = diasSemana;
	}

	public Date getDtInicio() {
		return this.dtInicio;
	}

	public void setDtInicio(Date dtInicio) {
		this.dtInicio = dtInicio;
	}
	
	public Date getDtCadastro() {
		return this.dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}
	

	public Date getDtTermino() {
		return this.dtTermino;
	}

	public void setDtTermino(Date dtTermino) {
		this.dtTermino = dtTermino;
	}

	public String getEntradasFrias() {
		return this.entradasFrias;
	}

	public void setEntradasFrias(String entradasFrias) {
		this.entradasFrias = entradasFrias;
	}

	public String getEntradasQuentes() {
		return this.entradasQuentes;
	}

	public void setEntradasQuentes(String entradasQuentes) {
		this.entradasQuentes = entradasQuentes;
	}

	public String getSobremesa() {
		return this.sobremesa;
	}

	public void setSobremesa(String sobremesa) {
		this.sobremesa = sobremesa;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public RestauranteFilialWeb getRestauranteFilialWeb() {
		return this.restauranteFilialWeb;
	}

	public void setRestauranteFilialWeb(RestauranteFilialWeb restauranteFilialWeb) {
		this.restauranteFilialWeb = restauranteFilialWeb;
	}
	
	public RestauranteSedeWeb getRestauranteSedeWeb() {
		return this.restauranteSedeWeb;
	}

	public void setRestauranteSedeWeb(RestauranteSedeWeb restauranteSedeWeb) {
		this.restauranteSedeWeb = restauranteSedeWeb;
	}
	
	public List<ComposicaoCardBuffetWeb> getComposicaoCardBuffetWebs() {
		return this.composicaoCardBuffetWebs;
	}

	public void setComposicaoCardBuffetWebs(List<ComposicaoCardBuffetWeb> composicaoCardBuffetWebs) {
		this.composicaoCardBuffetWebs = composicaoCardBuffetWebs;
	}

	public String getNomeBuffet() {
		return nomeBuffet;
	}

	public void setNomeBuffet(String nomeBuffet) {
		this.nomeBuffet = nomeBuffet;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
}